package dk.hojlind.hackhunt.model;
/**
*
* @author Dragon
*/
public class Advisory 
{
   private String affectedService = "";
   private String description = "";
   private String challenge = "";
   private String hint = "";
   private int ID = 0;
   private String title = "";
   private int correctLine = 0;
   
   /**
    * default constructor
    */
   public Advisory()
   {
       //do nothing
   }
   
   /**
    * constructor
    * @param affectedService the client service affected by this vuln
    * @param description a technical description of the issue, i.e. buffer overflow in username, sqli in select, etc
    * @param challenge the challenge the users needs to solve to be able to patch/exploit this
    * @param hint tutorial text on how to find the vuln
    * @param ID ID of the advisory
    */
   public Advisory(String title, String affectedService, String description, String challenge, String hint, int correctLine, int ID)
   {
       this.title = title;
       this.affectedService = affectedService;
       this.description = description;
       this.challenge = challenge;
       this.hint = hint;
       this.correctLine = correctLine;
       this.ID = ID;
   }
   
   public Advisory(String title, String affectedService, String description, String challenge, String hint, int ID)
   {
       this.title = title;
       this.affectedService = affectedService;
       this.description = description;
       this.challenge = challenge;
       this.hint = hint;
       this.ID = ID;
   }
   
   /**
    * gets the affected service
    * @return the affected service
    */
   public String getAffectedService()
   {
       return affectedService;
   }
   
   /**
    * sets the affected service
    * @param affectedService the service to set
    */
   public void setAffectedService(String affectedService)
   {
       this.affectedService = affectedService;
   }
   
   /**
    * gets the description
    * @return the description
    */
   public String getDescription()
   {
       return description;
   }
   
   /**
    * sets the description of the vuln
    * @param description the description
    */
   public void setDescription(String description)
   {
       this.description = description;
   }
   
   /**
    * gets the challenge
    * @return the challenge
    */
   public String getChallenge()
   {
       return challenge;
   }
   
   /**
    * sets the challenge
    * @param challenge the challenge to set
    */
   public void setChallenge(String challenge)
   {
       this.challenge = challenge;
   }
   
   /**
    * gets the hint
    * @return the hint
    */
   public String getHint()
   {
       return hint;
   }
   
   /**
    * sets the hint
    * @param hint the hint to set
    */
   public void setHint(String hint)
   {
       this.hint = hint;
   }
   
   /**
    * gets the ID
    * @return the ID
    */
   public int getID()
   {
       return ID;
   }
   
   /**
    * sets the ID of the advisory
    * @param ID the ID to set
    */
   public void setID(int ID)
   {
       this.ID = ID;
   }
   
   @Override
   /**
    * toString
    * @return a string representation of the object
    */
   public String toString()
   {
       return title + "\r\n" + affectedService + "\r\n" + description + "\r\n" + challenge + "\r\n" + hint + "\r\n" + ID + "\r\n";
   }
   
   /**
    * gets the title of the advisory
    * @return advisory title
    */
   public String getTitle()
   {
       return title;
   }
   
   /**
    * sets the title of the advisory
    * @param title the new title of the advisory
    */
   public void setTitle(String title)
   {
       this.title = title;
   }
   
   /**
    * gets the line that is the right answer to the challenge
    * @return 
    */
   public int getCorrectLine()
   {
       return correctLine;
   }
   
   /**
    * sets the correct line
    * @param correctLine the line that is correct
    */
   public void setCorrectLine(int correctLine)
   {
       this.correctLine = correctLine;
   }
   
   public static void main(String args[])
   {
       Advisory a = new Advisory("advisory title","webservice","this is the description section","what is 01101101 + 10010100? (this is your challenge)","heres how to do binary addition:",2,5);
       System.out.println(a);
   }
}